-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add FastMCPToolset #2784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FastMCPToolset #2784
Conversation
f68660d to
54367c8
Compare
54367c8 to
27592c7
Compare
|
@DouweM this is ready for review when you have a chance |
|
Basically I had implemented the content handling here, gotten annoyed at how weird it was, and then went and fixed it in FastMCP -- Once the next version of FastMCP comes out I was going to simplify the content handling here and return structured content if it's available and only return content if it's not (which I'm sure is what the MCP code was doing). Will incorporate the feedback tomorrow and work on simpler examples |
|
This PR is stale, and will be closed in 3 days if no reply is received. |
docs/toolsets.md
Outdated
|
|
||
| See the [MCP Client](./mcp/client.md) documentation for how to use MCP servers with Pydantic AI. | ||
|
|
||
| ### FastMCP Tools {#fastmcp-tools} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: before merging this, see if it makes sense to move this to a separate doc that can be listed in the "MCP" section in the sidebar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes in this direction
|
I think i may hold off on resource link support for now if that's okay. My guess is we'd want a kwarg that adds an optional tool for reading resources and maybe even list/read prompts from the target server? |
|
@strawgate Agreed, we have to do some work on MCP resource links anyway: #3099 |
|
@strawgate |
docs/mcp/client.md
Outdated
| ### Security | ||
|
|
||
| MCP Elicitation requires careful handling - servers must not request sensitive information, and clients must implement user approval controls with clear explanations. See [security considerations](https://modelcontextprotocol.io/specification/2025-06-18/client/elicitation#security-considerations) for details. | ||
| The [FastMCP-based Client](./fastmcp-client.md) offers a higher-level API with additional capabilities like Tool Transformation, simpler OAuth configuration, and more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also list anything the native client does support that FastMCP doesn't yet. Either here as, "supports X but not Y", or above.
|
This PR is stale, and will be closed in 3 days if no reply is received. |
|
Not stale! |
# Conflicts: # docs/mcp/client.md # uv.lock
|
@strawgate Thanks for your work here Bill! I found some time to wrap it up :) |
|
🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 |
|
🎉 |
Fixes: #2406
Introduces a FastMCPToolset which can take a FastMCP Client, a FastMCP Server, a config for an MCP Server, or an MCP JSON config.
This enables running FastMCP Servers in-memory, running Stdio servers via FastMCP, connecting to remote MCP Servers, transforming tools, etc.
Todo: